package castle.defense.project;


/**
 * Basic extension to the PhysicsPoint class that moves in a linear fashion.
 * @author Daniel Wasserman
 *
 */
public class LinearPoint extends PhysicsPoint {
	double speed, angle;
	long totalTime;
	double sx, sy;
	public LinearPoint(double x, double y, double speed, double angle)
	{
		super(x,y);
		this.sx = x;
		this.sy = y;
		this.speed = speed;
		this.angle = angle;
		totalTime=0;
	}
	public void update(long milli)
	{
		totalTime+=milli;
		this.x = Math.cos(angle) * (totalTime / 1000.0) * speed + sx;
		this.y = Math.sin(angle) * (totalTime / 1000.0) * speed + sy;
	}
}
